package com.ls.pattern.factory.simple.calculate;

import com.ls.pattern.factory.simple.calculate.cal.ICalculate;

/**
 * 计算方法工厂，简单工厂模式
 */
public class CalculateFactory {

    public ICalculate create(Class<? extends ICalculate> clazz) {
        try {
            return clazz.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
}
